﻿using System;
using System.Windows.Forms;

namespace ruscehproj2
{
    public partial class bk007 : Form
    {

        int i = 1;
        int i2 = 1;
        int i3 = 1;
        int i4 = 1;
        bool isActive = false;
        public bk007()
        {
            InitializeComponent();
        }

        public bool getState()
        {
            return isActive;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.i2++;
            if (this.i2 > 4) this.i2 = 1;
          //  if (this.i != 1) pictureBox1.Visible = true;
           // else pictureBox1.Visible = false;
            switch (this.i2)
            {
                case 1: button2.BackgroundImage = Resources.set01; break;
                case 2: button2.BackgroundImage = Resources.set02; break;
                case 3: button2.BackgroundImage = Resources.set03; break;
                case 4: button2.BackgroundImage = Resources.set04; break;
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.i4++;
            if (this.i4 > 3) this.i4 = 1;

            switch (this.i4)
            {
                case 1: button4.BackgroundImage = Resources.set4; break;
                case 2: button4.BackgroundImage = Resources.set5; break;
                case 3: button4.BackgroundImage = Resources.set6; break;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.i3++;
            if (this.i3 > 2) this.i3 = 1;

            switch (this.i3)
            {
                case 1: button3.BackgroundImage = Resources.set4; break;
                case 2: button3.BackgroundImage = Resources.set6; break;
               
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.i++;
            if (this.i > 4) this.i = 1;
            //  if (this.i != 1) pictureBox1.Visible = true;
            // else pictureBox1.Visible = false;
            switch (this.i)
            {
                case 1: button1.BackgroundImage = Resources.set01; break;
                case 2: button1.BackgroundImage = Resources.set02; break;
                case 3: button1.BackgroundImage = Resources.set03; break;
                case 4: button1.BackgroundImage = Resources.set04; break;
            }
        }

        private void bk007_KeyDown(object sender, KeyEventArgs e)
        {
     
            if (e.KeyCode == Keys.Escape)
            {
                this.Hide();
            }
        }

        private void bk007_Load(object sender, EventArgs e)
        {
            if (FormManager.hlp.helpEnabled())
            {
                if (FormManager.bsh03.getState())
                {
                    if (isActive)
                    {
                        FormManager.hlp.setHelpId("end");
                    }
                    else FormManager.hlp.setHelpId("vkl");
                    FormManager.hlp.hlpRefresh();
                }
                else
                {
                    FormManager.hlp.notSoFast();
                }



                FormManager.hlp.Show();
            }
            
        }

        private void bk007_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (isActive) FormManager.hlp.setHelpId("9");
            FormManager.hlp.Hide();
        }

        private void vkl_Click(object sender, EventArgs e)
        {
            if (FormManager.bsh03.getState())
            {
                isActive = true;
                FormManager.hlp.setHelpId("end");
                FormManager.hlp.hlpRefresh();
            }
        }
    }
}
